<template>
	<view>
		<label>未缴费</label>
		<text>\n\n</text>
		<view v-for="item in tickets1" style="background: url(../../static/red.jpg);width: 500rpx;height: 150rpx;border-radius: 20rpx;margin-left: 100rpx;">
			<text  >
				{{item.name}}
				{{item.money}}元
				\n
			</text>
		</view>
		
		<text>\n\n</text>
		<label>已缴费</label>
		<text>\n\n</text>
		<view  v-for="item in tickets2" style="background: url(../../static/grenn.jpg);width: 500rpx;height: 150rpx;border-radius: 20rpx;margin-left: 100rpx;margin-top: 20rpx;">
			<text  >
				{{item.name}}
				{{item.money}}元
				\n
			</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
			 tickets1:[],
			 tickets2:[]	 
			}
		},
		onShow() {
			var status=uni.getStorageSync("status");
			var userId=uni.getStorageSync("user").id;
			
			var type1="1";
			var type2="2";
			if(status=="1"){
				type1="3";
				type2="4";
			}
			
			
			uni.request({
			method:"GET",
			url:this.requestUrl+"/ForeTicket/findByType?type="+type1+"&userId="+userId,
			success:response=>{
				this.tickets1=response.data;
			}	
			})
			
			uni.request({
			method:"GET",
			url:this.requestUrl+"/ForeTicket/findByType?type="+type2+"&userId="+userId,
			success:response=>{
				this.tickets2=response.data;
			}	
			})
			
		}
		
		,
		methods: {
			
		}
	}
</script>

<style>

</style>
